<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./jquery.js"></script>
    <style>
        html,
        body {
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
        
        #angel {
            position: absolute;
        }
    </style>
</head>

<body>
    <img src="./angel.gif" alt="" id="angel" />

    <script>
        $(function() {
            var timer = null

            // 1. 获取到图片
            var angel = $('#angel')

            // 2. 绑定 mousemove 事件
            $(document).on('mousemove', function(e) {
                if (timer) {
                    return
                }

                timer = setTimeout(function() {
                    // 3. 设置图片的位置
                    $(angel)
                        .css('top', e.pageY + 'px')
                        .css('left', e.pageX + 'px')

                    console.log('ok')
                    timer = null
                }, 50)

            })
        })
    </script>
</body>

</html>